﻿using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;

namespace video
{
    /// <summary>
    /// 发送请求类
    /// </summary>
    class Request
    {
        public static async Task<HttpResponseMessage> Get(string url, Dictionary<string, string> headers)
        {
            HttpClient httpClient = new HttpClient();
            foreach (KeyValuePair<string, string> item in headers)
            {
                httpClient.DefaultRequestHeaders.Add(item.Key, item.Value);
            }
            HttpResponseMessage httpResponseMessage = await httpClient.GetAsync(url);
            return httpResponseMessage;
        }
    }
}
